package com.pms.dao.impl;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import com.pms.dao.EmployeePeriodDao;
import com.pms.pojo.Department;
import com.pms.pojo.Employee;
import com.pms.pojo.Post;
import com.pms.pojo.Require_yun;
import java.util.Date;
import java.text.SimpleDateFormat;

@Repository("employeePeriodDaoImpl")
public class EmployeePeriodDaoImpl implements EmployeePeriodDao {
	private  SqlSessionTemplate  sqlSessionTemplete;

	public void setSqlSessionTemplete(SqlSessionTemplate sqlSessionTemplete) {
		this.sqlSessionTemplete = sqlSessionTemplete;
	}
	@Override
	public List<Department> findDepartmentAll() {
		// TODO Auto-generated method stub
		String statement="com.pms.dao.EmployeePeriodMapper.getDepartments";
		return this.sqlSessionTemplete.selectList(statement);
	}

	@Override
	public List<Post> findPostAll() {
		// TODO Auto-generated method stub
		String statement="com.pms.dao.EmployeePeriodMapper.getPosts";
		return this.sqlSessionTemplete.selectList(statement);
	}
	@Override
	public Employee findEmployeeById(Integer empId) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public List<Require_yun> findRequire_yun(Require_yun require) {
		// TODO Auto-generated method stub
		String statement="com.pms.dao.EmployeePeriodMapper.getRequire_yun";
		return this.sqlSessionTemplete.selectList(statement,require);
	}
	@Override
	public List<Require_yun> findRequireTwo_yun(Require_yun require) {
		// TODO Auto-generated method stub
		String statement="com.pms.dao.EmployeePeriodMapper.getRequireTwo_yun";
		return this.sqlSessionTemplete.selectList(statement,require);
	}
	@Override
	public Require_yun findRequireOp_yun(Require_yun require) {
		// TODO Auto-generated method stub
		String statement="com.pms.dao.EmployeePeriodMapper.getRequireOp_yun";
		 this.sqlSessionTemplete.selectList(statement,require);
		return  this.sqlSessionTemplete.selectOne(statement,require);
	}
	@Override
	public void updateRegemp(Integer empId) {
		// TODO Auto-generated method stub
		String statement="com.pms.dao.EmployeePeriodMapper.updateRegemp";
		this.sqlSessionTemplete.update(statement,empId);
	}
	@Override
	public void updateNever(Integer empId) {
		// TODO Auto-generated method stub
		String statement="com.pms.dao.EmployeePeriodMapper.updateNever";
		this.sqlSessionTemplete.update(statement,empId);
	}
	@Override
	public void updateDela(Require_yun require) {
		// TODO Auto-generated method stub
		String statement="com.pms.dao.EmployeePeriodMapper.updateDela";
		this.sqlSessionTemplete.update(statement,require);
	}
	@Override
	public void updateEva(Require_yun require) {
		// TODO Auto-generated method stub
		String statement="com.pms.dao.EmployeePeriodMapper.updateEva";
		this.sqlSessionTemplete.update(statement,require);
	}
}
